from aiokafka import AIOKafkaConsumer


class Consumer:
    chi = None

    async def init(self, *args, **kwargs):
        self.chi = AIOKafkaConsumer(*args, **kwargs)

    async def star(self):
        await self.chi.start()

    async def __aiter__(self):
        async for msg in self.chi:
            yield msg


ksf_consumer = Consumer()
